<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.01.
   家居公司评论模型($$)*/

!defined('Q_PATH') && exit;

class JiajucompanycommentModel extends CommonModel{

	static public function init__(){
		return array(
			'table_name'=>'jiajucompanycomment',
			'autofill'=>array(
				array('user_id','userId','create','callback'),
				array('jiajucompanycomment_name','userName','create','callback'),
				array('jiajucompanycomment_ip','getIp','create','callback'),
				array('jiajucompanycomment_edituserid','userId','all','callback'),
				array('jiajucompanycomment_editusername','userName','all','callback'),
			),
			'check'=>array(
				'jiajucompanycomment_name'=>array(
					array('require',Q::L('点评名字不能为空','__APPJIAJU_COMMON_LANG__@Model')),
					array('max_length',50,Q::L('点评名字不能超过50个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
				'jiajucompanycomment_content'=>array(
					array('require',Q::L('点评内容不能为空','__APPJIAJU_COMMON_LANG__@Model')),
					//array('max_length',250,Q::L('点评内容不能超过250个字符','__APPJIAJU_COMMON_LANG__@Model')),
				),
			),
		);
	}

	static function F(){
		$arrArgs=func_get_args();
		return ModelMeta::instance(__CLASS__)->findByArgs($arrArgs);
	}

	static function M(){
		return ModelMeta::instance(__CLASS__);
	}

	protected function beforeSave_(){
		$this->jiajucompanycomment_content=C::text($this->jiajucompanycomment_content);
		$this->jiajucompanycomment_replycontent=C::text($this->jiajucompanycomment_replycontent);
		$this->jiajucompanycomment_replyusername=C::text($this->jiajucompanycomment_replyusername);
		$this->jiajucompanycomment_name=C::text($this->jiajucompanycomment_name);
		$this->jiajucompanycomment_editusername=C::text($this->jiajucompanycomment_editusername);
	}

}
